<?php
/**
 * Created by PhpStorm.
 * User: 0000336
 * Date: 2019/3/21
 * Time: 15:04
 */

namespace App\Service;


use Psr\Log\LoggerInterface;
use Symfony\Component\DependencyInjection\ParameterBag\ParameterBagInterface;

class MessageGenerator
{
    private $logger;

    public function __construct(LoggerInterface $logger, ParameterBagInterface $params)
    {
        $this->logger = $logger;

    }

    public function getHappyMessage()
    {


        $messages = [
            'You did it! You updated the system! Amazing!',
            'That was one of the coolest updates I\'ve seen all day!',
            'Great work! Keep going!',
        ];

        $index = array_rand($messages);
        $this->logger->info($messages[$index]);
        return $messages[$index];
    }
}